package com.crm.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.Map;

/**
 * @author Xanny
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class QueryDictTypeDto {

    // 字典名称
    private String dictName;
    // 字典类型
    private String dictType;
    // 状态（0正常 1停用）
    private Integer status;
    //分页页码
    private Integer pageNum=1;
    //分页页码
    private Integer pageSize=5;
    /**
     * 用来接受前端传入的params参数
     */
    private Map<String, Object> params;
    //开始时间

    private LocalDate beginTime;
    //结束时间

    private LocalDate endTime;

    public void check() {
        if (pageNum <= 0) {
            pageNum = 1;
        }
        if (pageSize <= 0 || pageSize >= 100) {
            pageSize = 10;
        }
    }
}